<extend name="Base/mob_common"/>
<block name="mob_body">
<script src="__JS__/raty/raty.js"></script>
<script src="__JS__/cat.js"></script>
<link rel="stylesheet" href="__CSS__/apps/cat.css"/>
<div class="housedetail-container ">


    <!--图片展示-->
    <div data-am-widget="slider" class="am-slider am-slider-default"
         data-am-slider='{animation:slide,slideshow:false,smoothHeight:true}'>
        <if condition="$detail['zhaopian1'] neq null">
            <ul class="am-slides">
                <li>
                    <img src="{$detail.zhaopian1.data}"style="height: 350px">

                    <div class="am-slider-desc">{$detail.zhaopian1.field.alias}</div>
                </li>

                <if condition="$detail['zhaopian2']['data'] neq  NULL">
                    <li>
                        <img src="{$detail.zhaopian2.data}"style="height: 350px">

                        <div class="am-slider-desc">{$detail.zhaopian2.field.alias}</div>
                    </li>
                </if>
                <if condition="$detail['zhaopian3']['data'] neq NULL">
                    <li>
                        <img src="{$detail.zhaopian3.data}"style="height: 350px">

                        <div class="am-slider-desc">{$detail.zhaopian3.field.alias}</div>
                    </li>
                </if>
                <if condition="$detail['zhaopian4']['data'] neq NULL">
                    <li>
                        <img src="{$detail.zhaopian4.data}"style="height: 350px">

                        <div class="am-slider-desc">{$detail.zhaopian4.field.alias}</div>
                    </li>
                </if>
                <if condition="$detail['zhaopian5']['data'] neq NULL">
                    <li>
                        <img src="{$detail.zhaopian5.data}"style="height: 350px">

                        <div class="am-slider-desc">{$detail.zhaopian5.field.alias}</div>
                    </li>
                </if>
            </ul>
        </if>
    </div>
    <!--图片展示END-->
    <!--发布时间和打分-->
    <div class="house-detail-head">
        <h4>{$info.title}
        </h4>

        <div class="tips-info am-cf" style="font-size: 12px;padding: 5px;border: 1px solid #c8c6c4;">
            <div class="user-info am-u-sm-4" style="font-size: 13px;text-align: center;padding:10px 0px 10px 0px">
                <div class=" avatar">
                    <img class="avatar-img" style="width:45px" src="{$info.user.avatar64}">
                </div>
                <div class="">
                    <span>发布人：</span>
                    <span><a href="{$info.user.space_mob_url}">{$info.user.nickname}</a></span></br>
                </div>
            </div>
            <div class="publish-time am-text-left am-u-sm-8"style="padding: 0px">
                <span>发布时间</span>{$info.create_time|friendlyDate}
                </br>
                <php>if($info['entity_id']==2){</php>
                <span>截止时间</span>{$info.over_time|time_format}
                <if condition="$info['overed'] eq 1">【已过期】</if>
                <if condition="$info['overed'] eq 0">【进行中】</if>
                </br>
                <php>}</php>

                <span>浏览量</span>{$info.read}

                <php>if (!D('Fav')->checkFav(is_login(), $info['id'])){</php>
                <a class="keep-item am-text-right"
                  >
                    <span id="collect" data-role="text" data-id="{$info.id}">收藏该帖</span>
                </a>
                <php>}else{</php>
                <a class="keep-item am-text-right">
                    <span id="collect" data-role="text" data-id="{$info.id}">取消收藏</span>
                </a>
                <php>}</php>
                <php>if(is_administrator(is_login())||$info['uid']==is_login()){</php>
                <php>if($info['entity_id']==1){</php>
                <a class="keep-item" href="{:U('mob/cat/addjob',array('edit'=>1,'infoId'=>$info['id'],'entity_id'=>$info['entity_id']))}">编辑</a>
                <php>}else if($info['entity_id']==2){</php>
                <a class="keep-item" href="{:U('mob/cat/addhouse',array('edit'=>1,'infoId'=>$info['id'],'entity_id'=>$info['entity_id']))}">编辑</a>
                <php>}else if($info['entity_id']==3){</php>
                <a class="keep-item" href="{:U('mob/cat/addptjob',array('edit'=>1,'infoId'=>$info['id'],'entity_id'=>$info['entity_id']))}">编辑</a>
                <php>}else if($info['entity_id']==5){</php>
                <a class="keep-item" href="{:U('mob/cat/addjianli',array('edit'=>1,'infoId'=>$info['id'],'entity_id'=>$info['entity_id']))}">编辑</a>
                <php>}else{</php>
                <a class="keep-item" href="{:U('mob/cat/addbase',array('edit'=>1,'infoId'=>$info['id'],'entity_id'=>$info['entity_id']))}">编辑</a>
                <php>}</php>
                <a class="keep-item" class="delinfo"  url={:U('mob/cat/delInfo')}  info_id="{$info.id}" index-url = "{:U('Mob/cat/index')}">删除</a>
                <php>}</php>
                <div class="right" style="margin-bottom: 1px"><span
                        class="corange">{$info.rate| number_format=1}</span>分
                    [&nbsp;<span class="corange"><php>echo
                        D('cat_rate')->where('info_id='.$info['info_id'])->count()
                    </php></span> &nbsp;{$info.ratecount}人打分]
                    <div id="rate" data-score="{$info.rate| number_format=1}"></div>
                </div>
            </div>

            <div class="am-cf"></div>


        </div>
    </div>
    <!--发布时间和打分END-->
    <!--内容介绍-->
    <if condition="$info['entity_id'] eq 1"><!--岗位-->
        <div class="house-mian-info">
            <ul class="am-avg-sm-2">
                <php>foreach($detail as $k=>$v){</php>
                <li class=""><span>{$v.field.alias}：</span>{$v.data}</li>
                <php>}</php>
            </ul>
        </div>
        <elseif condition="$info['entity_id'] eq 2"/>
        <!--房产-->
        <div class="house-mian-info">
            <ul class="am-avg-sm-2">
                <li class=""><span>{$detail.shenfen.field.alias}：</span>{$detail.shenfen.data}</li>
                <li class=""><span>{$detail.xiaoqu.field.alias}：</span>{$detail.xiaoqu.data}</li>
                <li class=""><span>{$detail.ting.field.alias}：</span>{$detail.ting.data}</li>
                <li class=""><span>{$detail.wei.field.alias}：</span>{$detail.wei.data}</li>
                <li class=""><span>{$detail.daxiao.field.alias}：</span>{$detail.daxiao.data}</li>
                <li class=""><span>{$detail.chaoxiang.field.alias}：</span>{$detail.chaoxiang.data}</li>
                <li class=""><span>{$detail.zhifu.field.alias}：</span>{$detail.zhifu.data}</li>
                <li class=""><span>{$detail.fangshi.field.alias}：</span>{$detail.fangshi.data}</li>
                <li class=""><span>{$detail.shi.field.alias}：</span>{$detail.shi.data}</li>
                <li class=""><span>{$detail.louceng.field.alias}：</span>{$detail.louceng.data}</li>
                <li class=""><span>{$detail.zhuangxiu.field.alias}：</span>{$detail.zhuangxiu.data}</li>
                <li class=""><span>{$detail.zujin.field.alias}：</span>{$detail.zujin.data}</li>
                <li class=""><span>{$detail.yijuhua.field.alias}：</span>{$detail.yijuhua.data}</li>
                <li class=""><span>{$detail.lianxiren.field.alias}：</span>{$detail.lianxiren.data}</li>
            </ul>
        </div>
        <elseif condition="$info['entity_id'] eq 3"/>
        <!--兼职-->
        <div class="house-mian-info">
            <ul class="am-avg-sm-2">
                <php>foreach($detail as $k=>$v){</php>
                <li class=""><span>{$v.field.alias}：</span>{$v.data}</li>
                <php>}</php>
            </ul>
        </div>
        <elseif condition="$info['entity_id'] eq 5"/>
        <!--简历-->
        <div class="house-mian-info">
            <ul class="am-avg-sm-2">
                <php>foreach($detail as $k=>$v){</php>
                <li class=""><span>{$v.field.alias}：</span>{$v.data}</li>
                <php>}</php>
            </ul>
        </div>

        <else/>
        <div class="house-mian-info">
            <ul class="am-avg-sm-2">
                <php>foreach($detail as $k=>$v){</php>
                <if condition="$v['field']['input_type'] eq 7">
                    <li class=""><span>{$v.field.alias}：</span><img src="{$v.data|getThumbImageById=100,100}"></li>
                    <else/>
                    <li class=""><span>{$v.field.alias}：</span>{$v.data}</li>
                </if>

                <php>}</php>
            </ul>
        </div>
    </if>

    <!--内容介绍END-->
<!--    详情-->
    <div class="comm-area">
        <h5 class="">信息详情</h5>

        <p>
            <if condition="$info['entity_id'] eq 3">
                        <span class="full-text">
                  {$detail.jieshao.data}
                </span>
            <else />
                      <span class="full-text">
                  {$detail.des.data}
                </span>
            </if>
        </p>
    </div>
<!--    详情END-->
    <!--评论-->

    {:local_comment_textarea(array('path'=>'Cat/index/'.$info[id],
    'uid'=>$info['uid'],'count_model'=>'index','count_field'=>'reply_count','this_url'=>'cat/index/detail'))}
    {:get_local_comment_list('Cat/index/'.$info[id])}
</div>


<script>
    collect();
    delInfo();
 
</script>
<script>
    var info_id = "{$info.id}";
    $('#rate').raty({path: "__JS__/raty/img", half: true,
        score: function () {
            return ($(this).attr('data-score'));
        },
        click: function (p_score, evt) {
            if (MID == 0) {
                toast.error('请登录后评分。');
                return;
            }
            $.post(U('Mob/cat/doScore'), {info_id: info_id, score: p_score}, function (msg) {
                if (msg.status) {
                    toast.success(msg.info);
                    setTimeout(function () {
                        location.reload();
                    }, 1000);
                }
                else {
                    toast.error(msg.info);
                }
            }, 'json');

        }
    });
</script>
</block>